/*
 * @Author: your name
 * @Date: 2020-04-30 10:21:56
 * @LastEditTime: 2020-05-27 11:42:48
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \v-nw-h5\src\store\modules\api\goods\storeGoods\mutations.js
 */
import Vue from 'vue'
export default {
    //分页获取店铺官网商品列表
    storeGoodsApi (state, obj) {
        let storeId = obj && obj.storeId ? obj.storeId : 0;
        let userId = obj && obj.userId ? obj.userId : 0;
        let classId = obj && obj.classId ? obj.classId : 0;
        let pageNum = obj && obj.pageNum ? obj.pageNum : 1;
        let pageSize = obj && obj.pageSize ? obj.pageSize : 10;
        let headItemId = obj && obj.headItemId ? obj.headItemId : 0;
        let params = {
            "pageNum": pageNum,
            "pageSize": pageSize,
            "classId": classId,
            "userId": userId,
            "headItemId": headItemId
        }
        let url = `${Vue.prototype.NW_API_API_LOCALE_VERSION}/website/store/${storeId}/item/list`;
        Vue.prototype.xurl.postDataJsonLoading(url, params).then((data) => {
            if (data.success) {
                if (obj && obj.successFn) {
                    obj.successFn(data);
                }
            } else {
                console.log(data);
            }
        })
    },
}